package com.itheima.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author itheima
 * @Date 2022/5/2 14:47
 */
@Controller
public class UserController {
    /**
     * 请求 http://localhost:8081/java142/index/robin  返回的是freemarker页面 hello,${name}
     *
     * @return
     */
    @GetMapping("/index/{name}")
    public String index(@PathVariable String name, Model model) {
        model.addAttribute("name", name);
        return "index";
    }
}
